<?php
$url = $_SERVER['PHP_SELF'];
$login = "";
$mycart = "";
$checkout = "";
$myaccount = "";
$faqs = ""; $shop = ""; $forum = ""; $about = ""; $contact = "";
$cars = "";
$index = "";
$signup=""; 
$tradein = "";
$ex = array();
$ex = explode("/",$url);
$n = count($ex)-1;

if($ex[$n] == "index.php"){
$index = 'class="selected"';

}
else if ($ex[$n] == "shop.php"){
$shop = 'class="selected"';

}
else if ($ex[$n] == "about.php"){
$about = 'class="selected"';

}
else if ($ex[$n] == "forum.php"){
$forum = 'class="selected"';

}
else if ($ex[$n] == "faqs.php"){
$faqs = 'class="selected"';

}
else if ($ex[$n] == "checkout.php"){
$checkout = 'class="selected"';

}
else if ($ex[$n] == "contact.php"){
$contact = 'class="selected"';

}
else if ($ex[$n] == "profile.php"){
$profile = 'class="selected"';

}
else if ($ex[$n] == "mycart.php"){
$mycart = 'class="selected"';

}
else if ($ex[$n] == "cars.php"){
$cars = 'class="selected"';

}
else if ($ex[$n] == "mylogin.php"){
$mylogin = 'class="selected"';

}
else if ($ex[$n] == "signup.php"){
$signup = 'class="selected"';
}
else if ($ex[$n] == "tradein.php"){
$tradein = 'class="selected"';
}

?>
<script>
jQuery(document).ready(function($){
	$('#keyword').autocomplete({source:"searchItem.php", minLength:1});
	
	$("#keyword").keypress(function (e){
		var value = $("#keyword");
		
		if(e.which == 13){
			window.location.href = "search.php?value="+value.val();
		}
		
	});
	
	
});
</script>

<!-- Include jQuery Library -->
<script src="../js/jquery-1.2.2.pack.js" type="text/javascript"></script>
<!-- Let's do the animation -->
<script type="text/javascript">
	$(function() {
		// set opacity to nill on page load
		$("ul#menu span").css("opacity","0");
		// on mouse over
		$("ul#menu span").hover(function () {
			// animate opacity to full
			$(this).stop().animate({
				opacity: 1
			}, "slow");
		},
		// on mouse out
		function () {
			// animate opacity to nill
			$(this).stop().animate({
				opacity: 0
			}, "slow");
		});
	});
</script>
<style>
#keyword{
position:relative;
z-index:50;
}
</style>

<div id="msgbox2"></div>
<div id="templatemo_header">
    
    	<div id="site_title" style="padding-bottom:3px;">
        	<h1><a href="index.php">Basci Autosales</a></h1>
        </div>
        
		<?php 
			include("include/div_login_logout.php");
		?>
        
        
        <div class="cleaner"></div>
    </div> <!-- END of templatemo_header -->
    
    <div id="templatemo_menu">
		
    	<div id="top_nav" class="ddsmoothmenu">
            <ul id="menu">
                <li><a href="cars.php" <?php echo $cars; ?>><img src="../images/cars.png" /><span><img src="../images/cars.png" /></span></a>
					<ul>
                      <li><a href="cars.php" <?php echo $cars; ?> >Brand New</a></li>
                      <li><a href="tradein.php" <?php echo $tradein;?>>Used Cars</a></li>
                   </ul>
				</li>
                <li><a href="shop.php" <?php echo $shop;?>><img src="../images/onlineshop.png" /><span><img src="../images/onlineshop.png" /></span></a></li>
				
				<li><a href="checkout.php" <?php echo $checkout;?> ><img src="../images/tradein.png" /><span><img src="../images/tradein.png" /></span></a></li> 
               
				<li><a href="about.php " <?php echo $about;?>><img src="../images/about.png" /><span><img src="../images/about.png" /></span></a></li>
                <li><a href="forum.php" <?php echo $forum;?>><img src="../images/forum.png" /><span><img src="../images/forum.png" /></span></a></li>
				<li><a href="contact.php" <?php echo $contact; ?>><img src="../images/contact.png" /><span><img src="../images/contact.png" /></span></a></li>
				<div id="templatemo_search">
					
					  <input type="text" value="Search"  name="keyword" title="keyword" id="keyword"  onfocus="clearText(this)" onblur="clearText(this)" class="txt_field" />
					  <!--input type="submit" value=" Search "  name="Search"  alt="Search" id="searchbutton" title="Search" class="sub_btn"  /-->
					
				</div>
            </ul>
            <br style="clear: left" />
        </div> <!-- end of ddsmoothmenu -->
		
        <div id="menu_second_bar">
        
        	
            <div class="cleaner"></div>
    	</div>
    </div> <!-- END of templatemo_menu -->
